/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.processing.base.helpers;

import java.util.Random;
import java.util.Vector;

/**
 *
 * @author nastya
 */
public class Algorithmic {
    public static Vector<Integer> randomValues(long count, int maxValue, Random r){
        if(count > maxValue){
            count = maxValue / 2;
        }
        
        Vector<Integer> result = new Vector<Integer>();
        
        int nextIndex;
        while (result.size() < count) {
            nextIndex = (int) (r.nextDouble() * maxValue);
            if (!result.contains(nextIndex)) {
                result.add(nextIndex);
            }
        }        
        
        return result;
    }
    public static Vector<Integer> randomValues(long count, int maxValue){
        Random r = new Random();
        return randomValues(count, maxValue, r);
    }
}
